package com.yxinsur.imc.business.enums;

import com.yxinsur.imc.common.utils.StringUtils;
import lombok.Getter;

@Getter
public enum FundMonthlyStrategyEnum {
    A("结算月上月"),
    B("结算月当月"),
    C("结算月次月"),
    D("固定日期");

    private String code;

    FundMonthlyStrategyEnum(String code) {
        this.code = code;
    }

    public static String getCode(String strategy) {
        String strategyValue = null;
        if (StringUtils.isNotBlank(strategy)) {
            for (FundMonthlyStrategyEnum c : FundMonthlyStrategyEnum.values()) {
                if (c.name().contains(strategy)) {
                    strategyValue = c.getCode();
                    break;
                }
            }
        }
        return strategyValue;
    }
}
